package com.example.dao;
import com.example.microinvestcommon.entity.BuyStock;
import com.example.microinvestcommon.entity.SellStock;
import com.example.microinvestcommon.entity.UserOrder;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;

@Mapper
public interface TransactMapper {

//    //提取用户交易的总信息
//    UserStockSummary getUserStockSummary(Integer userId);

    //提交用户的购买表单
    void addUserBuyStock(BuyStock buyStock);

    //创建userOrder记录
    void addUserOrder(UserOrder userOrder);

    //提交用户卖出的表单
    void addUserSellStock(SellStock sellStock);

    //返回用户某一stock的数量
    int returnOneStockTotalQuantity(Long userId,String stockSymbol);

    //增加用户的股票持有数量
    void addStockQuantity(Long userId,String stockSymbol,int quantity);

    //减少用户的股票持有数量
    void reduceStockQuantity(Long userId,String stockSymbol,int quantity);

    //添加用户购买的总amount
    void addUserTotalAmount(String stockSymbol, BigDecimal totalAmount);

    //减少用户购买的总amount
    void reduceUserTotalAmount(String stockSymbol, BigDecimal totalAmount);



}
